package com.mxx.qh;

import com.mxx.qh.interfaces.IGlobalException;

import org.jetbrains.annotations.NotNull;

/**
 * @ClassName: IException
 * @Description: java类作用描述
 * @Author: ljf89 (刘江飞)
 * @Date: 2021/1/12-- 11:44
 * @Email: 642371742@qq.com
 */
public class IExceptionHandler implements Thread.UncaughtExceptionHandler {
    private final IGlobalException iGlobalException;

    public IExceptionHandler(IGlobalException iGlobalException) {
        this.iGlobalException = iGlobalException;
    }

    public void uncaughtException(@NotNull Thread arg0, Throwable arg1) {
        iGlobalException.handlerException(arg1.getMessage());
    }
}
